# _*_ coding:utf-8 _*_
"""
__Author__    :  Icy
__Date__      :  2018/5/4
__File__      :  server.py
__Desc__      : 入口文件 启动项目和服务
"""
import tornado.ioloop
import tornado.options
import tornado.httpserver
from tornado.options import define, options
from application import application

# 命令行使用的参数
define("port", default=8000, type=int)


def main():
	tornado.options.parse_command_line()
	# 应用挂载服务
	http_server = tornado.httpserver.HTTPServer(application)
	http_server.listen(options.port)
	print('Development server is running at http://127.0.0.1:%s/' % options.port)
	print('Quit the server with Control-C')
	tornado.ioloop.IOLoop.instance().start()


if __name__ == "__main__":
	main()
